import http from "../utils/http";
// 获取角色列表
let getRoles = ()=>http(`roles`,'get');
// 删除指定权限
let deleteRoles = (roleId:number,rightId:number)=>http(`roles/${roleId}/rights/${rightId}`,'delete');
//获取权限列表
let getRights = ( type:string)=>http(`rights/${type}`,'get');

// 分配权限
let setRights = (roleId :number,data:SetRightsParams) =>http(`roles/${roleId}/rights`,'post',data);
export {
    getRoles,
    deleteRoles,
    getRights,
    setRights
}